import request from '@/utils/request'

// 查询产品规格列表
export function listSpecifications(query) {
  return request({
    url: '/sales/specifications/list',
    method: 'get',
    params: query
  })
}

// 查询产品规格详细
export function getSpecifications(specificationsId) {
  return request({
    url: '/sales/specifications/' + specificationsId,
    method: 'get'
  })
}

// 新增产品规格
export function addSpecifications(data) {
  return request({
    url: '/sales/specifications',
    method: 'post',
    data: data
  })
}

// 修改产品规格
export function updateSpecifications(data) {
  return request({
    url: '/sales/specifications',
    method: 'put',
    data: data
  })
}

// 删除产品规格
export function delSpecifications(specificationsId) {
  return request({
    url: '/sales/specifications/' + specificationsId,
    method: 'delete'
  })
}

// 计划编码状态修改
export function changeUserStatus(specificationsId, status) {
  const data = {
    specificationsId,
    status
  }
  return request({
    url: '/sales/specifications/changeStatus',
    method: 'put',
    data: data
  })
}
